#include <netfwd.h>

template<class T> struct WrapType { typedef T U; };
template<class T> struct typeof_class;

#define REGISTER_TYPEOF(N,T) \
	template<> struct typeof_class<N> { typedef T V; }; \
	char (*typeof_fct(const T &))[N];
	
#define typeof(x)  typeof_class<sizeof(*typeof_fct(x))>::V;	

REGISTER_TYPEOF( 1, std::map<std::string, int32_t>::iterator );

int32_t main( int32_t argc, char* argv[] )
{
	typedef std::map<std::string, int32_t> map1_t;
	map1_t map1_obj;
	std::cout << "iter type=" << typeid(map1_obj.begin()).name() << std::endl;
	std::cout << "iter pos=" << sizeof(*typeof_fct(map1_obj.begin())) << std::endl;
	return 0;
}

